#ifndef __XHUDPSOCK_H__
#define __XHUDPSOCK_H__

#pragma once

// MySock command target

class CXHUDPSock : public CAsyncSocket
{
public:
	CDialog *m_pDlg; //back pointers to the main dialog

	CString		m_sendBuffer;   //for async send
	CString		m_receiveBuffer;
	int			m_nBytesSent;
	int			m_nBytesBufferSize;
	void		DoAsyncSendBuff();
	CString m_Ip;
	UINT m_nPort;
	UINT m_LocalPort;
public:
	CXHUDPSock(CDialog* pDlg);
	~CXHUDPSock();
public:
	virtual void OnAccept(int nErrorCode);
	virtual void OnClose(int nErrorCode);
	virtual void OnConnect(int nErrorCode);
	virtual void OnOutOfBandData(int nErrorCode);
	virtual void OnReceive(int nErrorCode);
	virtual void OnSend(int nErrorCode);
	virtual int Receive(void* lpBuf, int nBufLen, int nFlags = 0);
	virtual int Send(const void* lpBuf, int nBufLen, int nFlags = 0);
};


#endif